package selcoursesys.entity;

import javax.persistence.*;

/**
 * Created by Lpbdz on 2017/4/9.
 */
@Entity
@Table(name = "major", schema = "manage_system", catalog = "")
public class MajorEntity {
    private String majorid;
    private String majorname;
    private String aid;
    private Double obcredit;
    private Double opcredit;
    private Double sumcredit;

    public void setObcredit(double obcredit) {
        this.obcredit = obcredit;
    }

    public void setOpcredit(double opcredit) {
        this.opcredit = opcredit;
    }

    public void setSumcredit(double sumcredit) {
        this.sumcredit = sumcredit;
    }

    @Id
    @Column(name = "majorid")
    public String getMajorid() {
        return majorid;
    }

    public void setMajorid(String majorid) {
        this.majorid = majorid;
    }

    @Basic
    @Column(name = "majorname")
    public String getMajorname() {
        return majorname;
    }

    public void setMajorname(String majorname) {
        this.majorname = majorname;
    }

    @Basic
    @Column(name = "aid")
    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    @Basic
    @Column(name = "obcredit")
    public Double getObcredit() {
        return obcredit;
    }

    public void setObcredit(Double obcredit) {
        this.obcredit = obcredit;
    }

    @Basic
    @Column(name = "opcredit")
    public Double getOpcredit() {
        return opcredit;
    }

    public void setOpcredit(Double opcredit) {
        this.opcredit = opcredit;
    }

    @Basic
    @Column(name = "sumcredit")
    public Double getSumcredit() {
        return sumcredit;
    }

    public void setSumcredit(Double sumcredit) {
        this.sumcredit = sumcredit;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MajorEntity that = (MajorEntity) o;

        if (majorid != null ? !majorid.equals(that.majorid) : that.majorid != null) return false;
        if (majorname != null ? !majorname.equals(that.majorname) : that.majorname != null) return false;
        if (aid != null ? !aid.equals(that.aid) : that.aid != null) return false;
        if (obcredit != null ? !obcredit.equals(that.obcredit) : that.obcredit != null) return false;
        if (opcredit != null ? !opcredit.equals(that.opcredit) : that.opcredit != null) return false;
        if (sumcredit != null ? !sumcredit.equals(that.sumcredit) : that.sumcredit != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = majorid != null ? majorid.hashCode() : 0;
        result = 31 * result + (majorname != null ? majorname.hashCode() : 0);
        result = 31 * result + (aid != null ? aid.hashCode() : 0);
        result = 31 * result + (obcredit != null ? obcredit.hashCode() : 0);
        result = 31 * result + (opcredit != null ? opcredit.hashCode() : 0);
        result = 31 * result + (sumcredit != null ? sumcredit.hashCode() : 0);
        return result;
    }
}
